<include file="public@header" />
</head>
<body style="background-color: #E5F3E6">
	<div class="wrap js-check-wrap" style="padding-top:0">
	<div class="row">
			<form method="post" class="js-ajax-form margin-top-20" 
            action="{:url('admin/Partol/addajax')}">
			<!-- 隐患信息填写弹框 -->
				<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		    		<div class="modal-dialog modal-lg"  >
		        		<div class="modal-content">
				            <div class="modal-header">
						        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						        <h5 class="modal-title" id="myModalLabel">隐患信息填写</h5>
						    </div>
						    <div class="modal-body" >
								<div class="row">
									<div class=" biaodan col-lg-12 col-md-12 col-sm-12 col-xs-12">	
									<div class="form-group col-md-6 col-sm-6">
										<label class="col-sm-4 control-label">排查部门
										<span style="color:red;">*</span>
										</label>
										<div class="col-sm-8">
										<input id="facId"  type="text" readonly="readonly" 
											class="form-control" placeholder="部门名称" value = '{$userDepartName}'/>
										</div>
									</div>
									<div class="form-group col-md-6 col-sm-6">
										<label class="col-sm-4 control-label">排查日期
										<span style="color:red;">*</span>
										</label>
										<div class="col-sm-8">
											<input autocomplete="off" class="form-control js-bootstrap-date" id="prdateId" name="hidenTime"/>
										</div>
									</div>
									<div class="form-group col-md-6 col-sm-6 ">
										<label class="col-sm-4 control-label">排查人
										<span style="color:red;">*</span>
										</label>
										<div class="col-sm-8">
											<input type="text" value="{$userName}" 
											class="form-control" >
										</div>
									</div>
										<div class="form-group col-md-6 col-sm-6 ">
										<label class="col-sm-4 control-label">排查方式
										<span style="color:red;">*</span>
										</label>
										<div class="col-sm-8">
											<select class="form-control" name="hidenPtrStyleID">
												<foreach name="hidenTypeData" item="vo">
													<option id = '{$vo.partolStyleID}' value='{$vo.partolStyleID}'>{$vo.partolStyleName}</option>
												</foreach>
											</select>
										</div>
									</div>						
									<div class="form-group col-md-6 col-sm-6 ">
										<label class="col-sm-4 control-label">隐患类别
										<span style="color:red;">*</span>
										</label>
										<div class="col-sm-8">
											<select class="form-control" name="hidenTypeID">
												<foreach name="dangerTypeData" item="vo">
													<option id = '{$vo.dangerTypeID}' value='{$vo.dangerTypeID}'>{$vo.dangerTypeName}</option>
												</foreach>							
											</select>
										</div>
									</div>
									<div class="form-group col-md-6 col-sm-6">
										<label class="col-sm-4  control-label">隐患级别
										<span style="color:red;">*</span>
										</label>
										<div class="col-sm-8">
											<select class="form-control" name="hidenLevel">
												<option value="一般">一般</option>
												<option value="重大">重大</option>
											</select>
										</div>
									</div>
									<div class="form-group col-md-6 col-sm-6">
										<label for="inputgsmc" class="col-sm-4  control-label">隐患描述
										<span style="color:red;">*</span>
										</label>
										<div class="col-sm-8">
											<textarea class="form-control" name="hidenInfo" rows="XX" cols="XX" ></textarea>
										</div>
									</div>	
									<div class="form-group col-md-6 col-sm-6">
										<label for="inputgsmc" class="col-sm-4  control-label">上传图片</label>
										<div class="col-sm-8">
											<a href="
												javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl')"
													class="btn btn-default">选择图片</a>
										</div>
									</div>
									</div>
								</div>
							</div>
			<div class="row">
				<div class="form-group">
				    <div class="text-center">
					    <input type="hidden" name="hidenFlag" value="0"/>
					    <button type="submit" id="save" 
					            class="btn btn-primary js-ajax-submit">提交</button>	            
					</div>
			    </div>
		    </div>
						</div>
					</div>
		</div>			
			</form>
		</div>
		<div class="row" style="text-align: center;margin-bottom: 15px;">
		<!--岗位风险信息-->
		<h4 class="text-center">巡查单位: <foreach name="departPosition" item="vd"><span>{$vd.name}&nbsp</span></foreach></h4>
		</div>
		
		<div class="row">
			<div class="col-lg-12 col-md-12">
				<table class="table table-striped table-bordered table-hover dataTables-example" 
				style="word-break:break-all; word-wrap:break-all;table-layout:fixed"
				  id = "tabDanger">
					<thead>
						<tr>
							<th>序号</th>
							<th>风险点名称</th>
							<th>辨识对象</th>
							<th>危害因素</th>
							<th>事故类型</th>
							<th>控制措施</th>
							<th>风险级别</th>
							<th>备注</th>
							<th>部门</th>
							<th>作业区域</th>
							<th>作业场所</th>
							<th>设备名称</th>
							<th width="160">检查情况(异常)</th>
						</tr>
					</thead>
					<tbody>

					<foreach name="data" item="vo">
					<tr>
						<th>{$vo.dangerID}</th>
						<th>{$vo.dangerName}</th>
						<th>{$vo.dangerObj}</th>
						<th>{$vo.dangerInfo}</th>
						<th>{$vo.accidentStand}</th>
						<th>{$vo.accidentMeasures}</th>
						<th>{$vo.dangerLevelName}</th>
						<th>{$vo.memos}</th>
						<th>{$vo.name}</th>
						<th>{$vo.workArea}</th>
						<th>{$vo.workplaceName}</th>
						<th>{$vo.equipmentName}</th>
						<td>
		                       <input type="checkbox"
		                       style="width: 20px;height: 20px;" 
		                       onclick='fun()'
		                       name="trueCheck" value="" />
		                    </td>
					</tr>					
					</foreach>
					</tbody>
				</table>
			</div>	
			<form method="post" class="js-ajax-form margin-top-20" 
            action="{:url('partol/partolResultInsert')}">
				<div class="form-group col-md-6 col-sm-6 ">
					<label class="col-sm-4 control-label">巡查人</label>
						<div class="col-sm-4">
							<input type="text" id ="ptrolID"
							name="partolPersonName" class="form-control" placeholder="请输入巡查人姓名">
						</div>
				</div>
				<div class="form-group">
		            <div class=" col-sm-10">
		             <input type="hidden" name="userID" value="{$uid}">
		                <button type="submit" class="btn btn-primary ">提交</button>
		                <a class="btn btn-default" href="{:url('Patrol/partolinfoindex')}">{:lang('BACK')}</a>
		             <!--    <a class="btn btn-default" href="{:url('hidendanger/hidenSearch')}">转上一级</a> -->
		            </div>
          		</div>
          	</form>		
		</div>

</div>

	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script src="__STATIC__/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
	<script src="__STATIC__/js/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
function fun(){
		  	var str = document.getElementsByName("trueCheck");
			var objarray = str.length;
			var con = "";
			for (i = 0; i < objarray; i++) {
			    if (str[i].checked == true) {
			    	//如果选中 弹框模态框
			    	$('#myModal').modal('show');
			        // con += str[i].value + ",";
			        // alert(con);
			    }
			}
		}		
</script>
</body>
</html>